<!-- xml version="1.0" encoding="utf-8" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<title>De Bello Gallico</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link href="../flashcard.css" rel="stylesheet" type="text/css">
</head>


<script type="text/javascript">
var sentences = [
  [ ["Postero", "die", "castra", "ex", "eo", "loco", "movent."],
    ["On-next", "day", "camp", "out-of", "that", "place", "they-move."] ],
  [ ["Idem", "facit", "Caesar,", "equitatumque", "omnem,", "ad", "numerum", "quattuor", "milium,"],
    ["Same", "does", "Caesar,", "cavalry-and", "all,", "to", "number", "four", "of-thousands,"] ],
  [ ["quem", "ex", "omni", "provincia", "et", "Aeduis", "atque", "eorum", "sociis", "coactum", "habebat,"],
    ["whom", "out-of", "all", "[the]-province", "and", "[the]-Aedui", "and-too", "of-those", "[the]-allies", "having-been-gathered-together", "he-had-at-command,"] ],
  [ ["praemittit,", "qui", "videant", "quas", "in", "partes", "hostes", "iter", "faciant."],
    ["before-he-sends,", "who", "may-see", "what", "into", "parts", "[the]-enemy", "journey", "make."] ],
  [ ["Qui", "cupidius", "novissimum", "agmen", "insecuti", "alieno", "loco", "cum", "equitatu", "Helvetiorum", "proelium", "committunt;"],
    ["Who", "too-eagerly", "[the]-last", "band", "after-having-followed", "in-unfavorable", "position", "with", "cavalry", "of-Helvetii", "battle", "join;"] ],
  [ ["et", "pauci", "de", "nostris", "cadunt."],
    ["and", "few", "from", "ours", "fall."] ],
  [ ["Quo", "proelio", "sublati", "Helvetii,", "quod", "quingentis", "equitibus", "tantam", "multitudinem", "equitum", "propulerant,"],
    ["By-which", "battle", "elated", "Helvetii,", "because", "with-five-hundred", "horsemen", "so-great", "[a]-multitude", "of-knights", "before-[them]-they-had-driven,"] ],
  [ ["audacius", "subsistere", "nonnumquam", "et", "novissimo", "agmine", "proelio", "nostros", "lacessere", "coeperunt."],
    ["more-boldly", "to-take-a-stand", "not-never", "even", "with-last", "troop", "in-battle", "our-men", "to-annoy", "began."] ],
  [ ["Caesar", "suos", "a", "proelio", "continebat,", "ac", "satis", "habebat", "in", "praesentia", "hostem", "rapinis", "pabulationibus", "populationibusque", "prohibere."],
    ["Caesar", "his-own", "from", "battle", "kept-holding-back,", "and", "enough", "held_[it]", "in", "the-present-circumstances", "[the]-enemy", "from-robberies", "foraging-expeditions", "plunderings-and", "to-hold-back."] ],
  [ ["Ita", "dies", "circiter", "quindecim", "iter", "fecerunt,"],
    ["So", "days", "about", "fifteen", "[the]-march", "they-made,"] ],
  [ ["uti", "inter", "novissimum", "hostium", "agmen", "et", "nostrum", "primum", "non", "amplius", "quinis", "aut", "senis", "milibus", "passuum", "interesset."],
    ["that", "between", "[the]-last", "of-[the]-enemies", "troop", "and", "our", "first", "not", "more_[than]", "five", "or", "six", "thousands", "paces", "intervened."] ]
];

var i = 0;
var j = 0;

var shown = 0;

function updateVoc() {
	
	var sentence = "";
	
	for(n = 0; n < sentences[i][0].length; n++) {
		if (n == j) {
			sentence += ' <span class="curword">' + sentences[i][0][n] + "</span>";
		} else {
			sentence += " " + sentences[i][0][n];
		}
	}
	
	document.getElementById('v3').innerHTML = sentence;
	
	if (shown == 0) {
		document.getElementById('v1').innerHTML = "";
	} else {
		document.getElementById('v1').innerHTML = sentences[i][1][j];
	}
}

function next() {
	shown++;
	if (shown > 1) {
		shown = 0;
		j++;
		if (j >= sentences[i][0].length) {
			j = 0;
			i++;
			if (i >= sentences.length) {
				i = 0;
				alert('All done!');
			}
		}
	}
	updateVoc();
}

function prev() {
	shown--;
	if (shown < 0) {
		shown = 1;
		j--;
		
		if (j < 0) {
			i--;
			if (i < 0) {
				i = sentences.length - 1;
				alert('All done!');
			}
			j = sentences[i][0].length - 1;
		}
	}
	
	updateVoc();
}

</script>

<body onload="updateVoc()">
<h1 style="text-align:center; color: #60B0C0;">Liber I - Caput XV</h1>

<div class="center">
<div id="v3" class="v3"></div>
<div id="v2" class="v2">&nbsp;</div>
<div id="v1" class="v1"></div>


<a href="#" class="button" id="btnprev" onclick="prev()" accesskey="p">&lt;&lt;</a>
<a href="#" class="button" id="btnnext" onclick="next()" accesskey="n">&gt;&gt;</a>


</div>
</body>
</html>
